package com.way.flow

import org.junit.Test

/**
 *  create by wang wei 2024/11/20
 *  email: Way_540927094@163.com
 *  describe:
 */
class Test_Interface {

    @Test
    fun testProperty(){
//        val man: IHuman = Man(Man.NAME.toString(), Man.SEX_MAN)
        val man: IHuman = Man(NAME_T.toString(), Man.SEX_MAN)
        println(man)
    }

}



interface IHuman{
    val name: String
    var sex: String


}

class Man(override val name: String, override var sex: String) : IHuman{

    companion object {
        const val SEX_MAN: String = "male"
        const val SEX_FEMALE: String = "female"
        val NAME: Name = Name("Way", "Wang")
    }
    override fun toString(): String {
        return "Man(name='$name', sex='$sex')"
    }
}

data class Name(val firstName: String, val lastName: String)


val NAME_T = Name("Way", "Wang")